import { ref } from 'vue'
import { defineStore } from 'pinia'

export const useUserInfoStore = defineStore('userInfo', () => {
    // 定义相关状态
    const info = ref({})

    // 设置用户信息
    const setInfo = (newInfo) => {
        info.value = newInfo
    }

    // 移除用户信息
    const removeInfo = () => {
        info.value = {}
    }

    return { info, setInfo, removeInfo }
}, { persist: true })

export default useUserInfoStore